package com.yellow.dispatchservice.controller;

import com.yellow.dispatchservice.entity.Vehicle;
import com.yellow.dispatchservice.service.VehicleService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author: hy
 * @create: 2024-04-23
 */
@RestController
@Slf4j
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/vehicle")
public class VehicleController {

    @Resource
    private VehicleService vehicleService;

    @GetMapping("/getVehicleByCourierName/{name}")
    public Vehicle getVehicleByCourierName(@PathVariable(value = "name") String courierName) {
        return vehicleService.getVehicleByCourierName(courierName);
    }
}
